package com.finance.system.service;

import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import com.finance.base.exception.BaseException;
import com.finance.system.bean.pojo.Menu;
import com.finance.system.bean.pojo.Role;
import com.finance.system.bean.pojo.User;

import java.util.List;

/**
 * Created by CBWL on 2017/3/17.
 */
public interface IRoleService {

    Role getById(String id);

    List<Role> listAll();

    PageResultBO<Role> listByPage(Page page);

    boolean add(Role role,List<String> menuIds) throws BaseException;

    boolean delete(String id) throws BaseException;

    boolean update(Role role,List<String> menuCodes) throws BaseException;

    boolean batchDelRole(List<String> ids);

    List<Role> list4User(User user);

    boolean add4User(User user, User authUser, Role role);

    boolean modify4user(User user, User authUser, Role role);

    Role query4User(User user, Long roleId);

    boolean delRoleMenu(String roleId) throws BaseException;

    boolean deleteUserRole(String roleId) throws BaseException;

    boolean delUserRole(String roleId) throws BaseException;

    List<Menu> listMenus(Role role);

    List<Role> listRoles();

    boolean updateMenuRel(Long roleId,Long uId,List<String> menuCodes) throws BaseException;

    Role getByRoleId(Long roleId);
}
